/**
 * @author mili
 */
var incidentFiles;
var timeNames = [
	"12:23:47 - 13:23:46, 2012-11-12",
	"11:55:03 - 12:55:02, 2012-11-14",
	"09:55:48 - 10:55:47, 2012-11-16",
	"07:09:48 - 08:09:47, 2012-11-18",
	"13:12:18 - 14:12:17, 2012-11-20",
	"05:42:02 - 06:42:01, 2012-11-22",
	"17:27:16 - 18:27:15, 2012-11-23",
	"17:24:02 - 18:24:01, 2012-11-25",
	"10:59:02 - 11:59:01, 2012-11-27",
	"20:30:03 - 21:30:02, 2012-11-28",
	];
var timeMap = [];

// call function to get the object array of json file names
function getTimeStamp(){
	var ret = (function(){
		var obj = null;
		$.ajax({
			'async':false,
			'global':false,
			'url':server_url+"?type=incidents&flag=no-debug",
			'success':function(data){
				obj = data;
			}
		});
		return obj;
	})();
	var incidentFiles = JSON.parse(ret);
	
	for(var i = 0; i < 10; i++){
		timeMap[timeNames[i]] = incidentFiles[i];
		document.timestamp.timeline.options[i] = new Option( timeNames[i],"timestamp1", false, false);
	}
}

// call to get the start time of this file from server
function getStartTime(file){
	var ret = (function(){
		var obj = null;
		$.ajax({
			'async':false,
			'global':false,
			'url':server_url+"?type=getStartTime&flag=no-debug&file="+file,
			'success':function(data){
				obj = data;
			}
		});
		return obj;
	})();
	return ret;
}
